Skip to content

SG-47353 Run the tests with the shared tk-ci-tools test jobs - #471

Open
julien-lang wants to merge 9 commits into
masterfrom
ticket/SG-47353-test-matrix-latest-images
Open

julien-lang wants to merge 9 commits into
masterfrom
ticket/SG-47353-test-matrix-latest-images

Conversation

@julien-lang

@julien-lang julien-lang commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Child of the tk-ci-tools pull request shotgunsoftware/tk-ci-tools#90 (SG-47353).

Run the tests with the shared tk-ci-tools test jobs instead of a local copy of the OS × Python matrix. This relies on shotgunsoftware/tk-ci-tools#88 (merged), which defaults every platform to the -latest runner images and adds the per-repository test overrides, and shotgunsoftware/tk-ci-tools#90, which adds the toolkit flag and the run_tests_parameters key names used here.

Changes

  • azure-pipelines.yml calls build-pipeline.yml with has_unit_tests on and keeps the default platforms (Python 3.9, 3.10, 3.11, 3.13). Each one runs on Linux, macOS and Windows with the -latest runner images, except Python 3.9 on Linux which uses ubuntu-24.04.
  • run_tests_parameters sets toolkit: false, because the Python API is not a Toolkit component: no Qt wrapper, tk-toolchain or tk-core. With tk-core, the tests would import the shotgun_api3 bundled with tk-core instead of this repository's code.
  • Test requirements are installed through run_tests_parameters.pip_requirements (--requirement=tests/requirements.txt).
  • The type checking job is listed first, and has_ui_resources: false comes before the test parameters.
  • The rest of what the removed test template did now goes through run_tests_parameters and post_tests_steps:
    • pre_steps creates tests/config from tests/example_config, and imports the Amazon root certificate on Windows.
    • env sets the SG_* variables: the test site and its secrets, and a human user and project per job, named after the OS and Python version ($(tk_ci_os_name) and $(tk_ci_python_version)), as before.
    • pytest_args keeps the reruns (--reruns 1 --reruns-delay 2).
    • A post-test step deletes the test project, even when the tests fail.
  • The local test job template is removed.
  • The tk-ci-tools ref points at the branch of SG-47353 Add a toolkit flag and shorten the test override keys tk-ci-tools#90 for testing.

Testing

  • To check: 12 test jobs with the same names as before, the same number of tests running as on master (282 passed and 3 skipped per job), the Toolkit setup steps shown as skipped, and the test project deleted at the end of each job.

Do not merge as is: revert the tk-ci-tools ref to refs/heads/master once shotgunsoftware/tk-ci-tools#90 is merged.

🤖 Drafted with Claude Code and GitHub Copilot

julien-lang and others added 3 commits November 19, 2026 16:07
Replace the local OS x Python test matrix with build-pipeline.yml, listing this repository's own Python versions in run_tests_extra_parameters. Each one runs on the -latest runner images, except Python 3.9 on Linux. Points tk-ci-tools at its feature branch for testing; revert the ref to master before merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Python versions are the same as the tk-ci-tools defaults, so there is nothing to override. Keep has_unit_tests explicit to point at the shared test defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Otherwise the tests import the shotgun_api3 bundled with tk-core instead of this repository's code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.65%. Comparing base (e3b23a9) to head (4cb1bfe).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #471   +/-   ##
=======================================
  Coverage   81.65%   81.65%           
=======================================
  Files           7        7           
  Lines        1935     1935           
=======================================
  Hits         1580     1580           
  Misses        355      355           
Flag Coverage Δ
Linux 81.65% <ø> (ø)
Python-3.10 81.60% <ø> (ø)
Python-3.11 81.60% <ø> (ø)
Python-3.13 81.60% <ø> (ø)
Python-3.9 81.59% <ø> (ø)
Windows 81.72% <ø> (ø)
macOS 81.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The shared CI job silently skips both mocked client test classes because it lacks server URL configuration, leaving unit-test coverage disabled alongside live-site tests.

1 open issue
What changed in this PR

This PR migrates Python API testing to shared tk-ci-tools jobs, removing the locally maintained OS × Python matrix. It remains an experimental integration with tk-ci-tools#88 and explicitly acknowledges reduced live-site coverage.

Changes:

  • Enables shared tests for four Python versions across Linux, macOS, and Windows.
  • Installs repository test requirements and disables tk-core loading so tests use this repository’s API.
  • Points to the shared-template feature branch and removes the local test-job template.
File Description
azure-pipelines.yml Enables and configures shared test jobs using the experimental tk-ci-tools branch.
azure-pipelines-templates/​run-tests.yml Removes local test execution, live-site setup, cleanup, and reporting steps.

Review effort: Balanced

Comment thread azure-pipelines.yml
# runner images), defined in internal/run-tests.yml of tk-ci-tools. Review
# those defaults when they change, and override them with
# run_tests_extra_parameters if this repository needs something else.
has_unit_tests: true
julien-lang and others added 3 commits November 23, 2026 11:58
Use the new tk-ci-tools options to restore what the removed test template
did: the test configuration, the site credentials with secrets mapped
explicitly, a test user per OS and Python version, the Windows certificate
import, the pytest reruns and the test project cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the type checking job first so it is not lost after the test jobs,
set has_ui_resources before the test parameters, and list the test
dependencies in run_tests_extra_parameters with the other test settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tk-ci-tools changes are merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@julien-lang
julien-lang marked this pull request as ready for review November 23, 2026 22:09

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared job also installs a Qt wrapper and tk-toolchain, which the Python API tests don't need.

Can we add a flag so tk-ci-tools won't install those dependencies? Maybe something telling that requires_tk_dependencies (python-api, jira bridge are not TK and don't require toolchain and Qt). This could impact CI time per runner.

Rename run_tests_extra_parameters and its keys to the names of the
tk-ci-tools follow-up, and set toolkit to false: this repository is not a
Toolkit component, so the tests need no Qt wrapper, tk-toolchain or
tk-core. Point tk-ci-tools at the follow-up branch for testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@julien-lang
julien-lang marked this pull request as draft November 25, 2026 21:31
Comment thread azure-pipelines.yml Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@julien-lang

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@julien-lang
julien-lang marked this pull request as ready for review November 25, 2026 22:57
Follow the tk-ci-tools rename of the run_tests_parameters key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants